/**
	Pulsar engine. Additional include file.
	Default compiler and OS setup.

	Copyright (C) 2013-2014 Dmitry Dolgov

	This program is free software; you can redistribute it and/or modify it under the terms of the
	GNU General Public License as published by the Free Software Foundation; either version 2 of
	the License, or (at your option) any later version.

	This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
	without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
	See the GNU General Public License for more details.
*/

//
// Compiler spec setup
//
#if defined(PL_MSC)
	#include <pulsar/inc/msc/pulsar_setup_msc.h>
#elif defined(PL_GCC)
	#include <pulsar/inc/gcc/pulsar_setup_gcc.h>
#else
#error "Wrong compiler type"
#endif

//
// Platform spec setup
//
#if defined(PL_WINDOWS) || defined(PL_WINDOWS64)

	#include <pulsar/inc/win/pulsar_defsetup_win.h>

#elif defined (PL_LINUX)

	#include <pulsar/inc/linux/pulsar_defsetup_linux.h>

#else
	#error "Wrong Operation System"
#endif

// MAX_PATH setup
#if defined(MAX_PATH) && defined(FILENAME_MAX)
#if MAX_PATH != FILENAME_MAX
#error "Platform definition mismatch"
#endif
#endif

#if !defined(MAX_PATH) && defined(FILENAME_MAX)
#define MAX_PATH FILENAME_MAX
#endif

#if defined(MAX_PATH) && !defined(FILENAME_MAX)
#define FILENAME_MAX MAX_PATH
#endif

// PL_TEXT() macro
#if defined(PL_ANSI)
typedef char pl_char;
#define __PL_TEXT(text) text

#elif defined(PL_UNICODE) || defined(PL_UNICODE32)
typedef wchar_t pl_char;
#define __PL_TEXT(text) L ## text

#else
#error "Wrong String type"
#endif

#define PL_T(text) __PL_TEXT(text)

// FOURCC code
#if defined(PL_BYTE_LE)
#define PL_FOURCC(a, b, c, d)      ((pl_uint32)(pl_uint8)(d)       |  \
                                    (pl_uint32)(pl_uint8)(c) <<  8 |  \
                                    (pl_uint32)(pl_uint8)(b) << 16 |  \
                                    (pl_uint32)(pl_uint8)(a) << 24)
#elif defined(PL_BYTE_BE)
#define PL_FOURCC(a, b, c, d)      ((pl_uint32)(pl_uint8)(a)       |  \
                                    (pl_uint32)(pl_uint8)(b) <<  8 |  \
                                    (pl_uint32)(pl_uint8)(c) << 16 |  \
                                    (pl_uint32)(pl_uint8)(d) << 24)
#error "Wrong byte ordering"
#endif

#define PL_FUNCTION_NAME PL_T(__FUNCTION__)

#if !defined(TRUE)
#define TRUE 1
#endif

#if !defined(FALSE)
#define FALSE 0
#endif

//
// End of file 'pulsar_defsetup.h'
//
